﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;

namespace printer
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void browse_Click(object sender, EventArgs e)
        {
            List<string>[] orer_list=new List<string>[2];
            reciptionist r1 = new reciptionist();
            order order = new printer.order();
         orer_list= r1.orer_list( r1.get_MinUrl1());
        double cost= r1.make_order(orer_list, ref order, 3);
        label3.Text = cost.ToString();


        }

public  void ListFiles (string  directoryPath )
            {
             DirectoryInfo directoryInfo= new DirectoryInfo(directoryPath);
             FileStream fileStream = null;
             
             if(directoryInfo.Exists)
                {
                    if (File.Exists(directoryPath))
                    { }
                    else
                    {
                        FileInfo[] fileInfo = directoryInfo.GetFiles();
                        DirectoryInfo[] subdirectoryInfo = directoryInfo.GetDirectories();

                        foreach (DirectoryInfo subDirectory in subdirectoryInfo)
                        {
                            ListFiles(subDirectory.FullName);
                        }
                        foreach (FileInfo file in fileInfo)
                        {
                            //Please put code to put the name of file  and directory in some list or dictionary

                            listBox1.Items.Add(file);
                        }
                    }
                   
                    }       
                        
                  }
             





        private void button1_Click(object sender, EventArgs e)
        {
           reciptionist r1 = new reciptionist();
           ListFiles(r1.get_MinUrl1());
            //r1.make_order(ref order ,
        }
    }
}
